while True:
 s=input()
r=0
for i in range(len(s)):
 r+=ord(s[i])*(256**(i))
print(r)
